﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using jp110311.StorageModels;
using System.ComponentModel;

namespace MvcWebRole1.Models
{
    // Bbs の地域内のモデル
    public class BbsAreaIndexModel
    {
        public string ZipCode { get; set; }

        public string Tag { get; set; }

        public int PageSize { get; set; }

        public int CurrentPage { get; set; }

        public int Total { get; set; }

        public ICollection<BbsEntity> Messages { get; private set; }

        public BbsAreaIndexModel()
        {
            Messages = new List<BbsEntity>();
        }
    }

    public class BbsPostModel
    {
        public string ZipCode { get; set; }

        [Required(ErrorMessage = "タイトルを入力してください。")]
        [DisplayName("タイトル (必須)")]
        public string Title { get; set; }

        [Required(ErrorMessage = "投稿内容を入力してください。")]
        [DisplayName("投稿内容 (必須)")]
        public string Content { get; set; }

        [DisplayName("タグ")]
        public string TagList { get; set; }

        // 以下コントローラーで設定
        public string AuthorZipCode { get; set; }
        public string AuthorName { get; set; }
    }

    public class BbsTagIndexModel
    {
        public string ZipCode { get; set; }

        public ICollection<BbsTagEntity> Tags { get; private set; }

        public BbsTagIndexModel()
        {
            Tags = new List<BbsTagEntity>();
        }
    }

    public class BbsTagPostModel
    {
        public string ZipCode { get; set; }

        public string BbsMsgId { get; set; }

        [Required(ErrorMessage = "タグを入力してください。")]
        [DisplayName("タグ")]
        public string TagList { get; set; }
    }
}